﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>图像和颜色的绘制</title>
</head>
<body>
<?php
    header("Content-type:image/gif");
	$img = imagecreate(800,500);
	$bgcolor = imagecolorallocate($img,0,255,255);//背景色为白色
	imagefill($img,0,0,$bgcolor);
	$black=imagecolorallocate($img,0,0,0);
	$w=imagecolorallocate($img,255,255,0);
	imagearc($img,100,75,100,60,45,270,$black);
	imagedashedline($img,120,50,220,150,$w);
	imageline($img,140,50,240,150,$black);
	imagerectangle($img,400,30,490,170,$black);
	$pointlist=array(250,60,270,30,320,80,240,130,230,25,235,15);
	imagepolygon($img,$pointlist,count($pointlist)/2,$black);
	ob_clean();  
	flush();
	imagegif($img);
	imagedestroy($img);
?>
</body>
</html>